#include <iostream>
#include <string>
#include <memory>

#include "task.pb.h"

using namespace RPC_COMMUNICATION;

int main()
{
    try{

    LoginRequest LR;
    LR.set_id("1");
    LR.set_password("20251029");

    std::string send_str;
    if(LR.SerializeToString(&send_str))
    {
        std::cout << send_str << std::endl;
    }

    LoginRequest LR_Dump;
    if(LR_Dump.ParseFromString(send_str))
    {
        std::cout << LR_Dump.id() << std::endl;
        std::cout << LR_Dump.password() << std::endl;
    }
    
    }
    catch(const std::exception& _excption)
    {
        std::cout << _excption.what() << std::endl;
    }
    catch(...)
    {
        std::cout << "未知错误" << std::endl;
    }

}